package indoor.nexd.com.nexdmap.routeplan;

import java.io.Serializable;
import java.util.List;

public class Vertex implements Comparable<Vertex>, Serializable {

    private static final long serialVersionUID = 3282853030773933498L;

    public final String name; // 节点的名字
    public List<Edge> adjacencies; // 节点的连接边
    public double minDistance = Double.POSITIVE_INFINITY; //Double.POSITIVE_INFINITY;   到初始点的距离
    public double[] location; // 节点位置坐标
    public Vertex previous; // 上一个节点坐标

    public Vertex(String argName) {
        name = argName;
    }

    public String toString() {
        return name;
    }

    public int compareTo(Vertex other) {
        return Double.compare(minDistance, other.minDistance);
    }
}